/************************************
*  Copyright (C) 2010 Julien MOTTIN.
*  Contact: julien.mottin@gueydan.eu
*
*  This file is part of Gueydan.
*
*  Gueydan is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  Gueydan is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with Gueydan.  If not, see <http://www.gnu.org/licenses/>.
*
*************************************/
#ifndef STYLE_H
#define STYLE_H

// QtCore
#include <QString>

// Local
#include "color.h"
#include "beerxmlobject.h"

enum StyleType
{
    STLager = 0,
    STAle,
    STWheat,
    STMead,
    STMixed,
    STCider
};

class Style : public BeerXMLObject
{
    Q_OBJECT;
    
public:

    // Standard Ctor with all mandatory fields
    Style(const QString &iName,
          const int iVersion,
          const QString &iCategory,
          const int iCategoryNumber,
          const QString &iStyleLetter,
          const QString &iStyleGuide,
          const StyleType &iType,
          const float iOGMin,
          const float iOGMax,
          const float iFGMin,
          const float iFGMax,
          const float iIBUMin,
          const float iIBUMax,
          const Color &iColorMin,
          const Color &iColorMax);
    Style();
    ~Style();

    // Comparison
    bool operator==(const Style &iOther) const;
    bool operator==(const BeerXMLObject &iOther) const;
    bool operator!=(const Style &iOther) const;
    bool operator!=(const BeerXMLObject &iOther) const;

    /*
    * virtual XML IO
    * returns :
    *   - 0 : Success
    *   - 1 : Invalid XML
    */
    int CreateFromXMLNode(const QDomNode &iNode);
    int ToXMLNode(QDomNode &iParentNode) const;

public:

    QString     _Category;
    int         _CategoryNum;
    QString     _StyleLetter;
    QString     _StyleGuide;
    StyleType   _Style;
    float       _OGMin,_OGMax;
    float       _FGMin,_FGMax;
    float       _IBUMin,_IBUMax;
    Color       _ColorMin,_ColorMax;
    float       _ABVMin,_ABVMax;
    QString     _Notes;
    QString     _Examples;

private:
    Style(const Style &iOther);
    Style & operator=(const Style &iOther);

};

#endif // STYLE_H
